package com.bjor.beerdaddy;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.InputConnection;
import android.widget.ImageView;


public class PickPlanActivity extends Activity {

	private ImageView btnBuzz, btnNOD, btnTime;
	//private TextView tvBuzz, tvNOD, tvTime;
	private Intent intent;
	public static final String PREFS_NAME = "hbvBDPrefsFile";
	SharedPreferences sharedPref;
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_pick_plan);
		
		sharedPref = getSharedPreferences(PREFS_NAME, 0);
		
		btnBuzz = (ImageView) findViewById(R.id.buttonbuzz);
		btnNOD = (ImageView) findViewById(R.id.buttonnod);
		btnTime = (ImageView) findViewById(R.id.buttontime);
		
		btnBuzz.setOnClickListener(buzzOnClickListener);
		btnNOD.setOnClickListener(nodOnClickListener);
		btnTime.setOnClickListener(timeOnClickListener);
	}

	protected OnClickListener buzzOnClickListener = new OnClickListener()
    {
		@Override
		public void onClick(View v) {
			SharedPreferences.Editor editor = sharedPref.edit();
			editor.putString("type", "buzz");
			editor.commit();
			
			MainController.outsideIntent(SettingsActivity.class.toString());
		}
    };
    
    protected OnClickListener nodOnClickListener = new OnClickListener()
    {
		@Override
		public void onClick(View v) {
			SharedPreferences.Editor editor = sharedPref.edit();
			editor.putString("type", "nod");
			editor.commit();
			
			MainController.outsideIntent(SettingsActivity.class.toString());
		}
    };
    
    protected OnClickListener timeOnClickListener = new OnClickListener()
    {
		@Override
		public void onClick(View v) {
			SharedPreferences.Editor editor = sharedPref.edit();
			editor.putString("type", "time");
			editor.commit();
			
			MainController.outsideIntent(SettingsActivity.class.toString());
		}
    };

}
